package cn.lx.ssh.service;


import java.util.List;


import org.springframework.transaction.annotation.Transactional;

import cn.lx.ssh.dao.ProductDao;
import cn.lx.ssh.domain.Product;

/**
 * 商品管理的业务层
 * @author issuser
 *
 */
@Transactional
public class ProductService {
	
	//业务层注入Dao层
	private ProductDao productDao;
	public void setProductDao(ProductDao productDao) {
		this.productDao = productDao;
	}
	public void save(Product product) {
		System.out.println("service中的save方法执行啦");
		productDao.save(product);
	}
	

	public List<Product> getList(){
		List<Product> list = productDao.getList();
		return list;
	}
	
	
	public Product findById(Integer pid){
		Product product = productDao.findById(pid);
		return product;
	}
	


}
